<ui:fragment
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.prime.com.tr/ui">

    <p:dialog header="#{bundle.Novo_emprestimo}" draggable="true" widgetVar="emprestimo_new">
        <h:form id="emprestimo_newF">
            <p:messages id="msgs"/>
            <h:panelGrid columns="2" style="width:100%;text-align:left;">
                <h:outputLabel value="#{bundle.ID}" />
                <h:outputText value="#{emprestimoController.emprestimo.id}" />


                <h:outputLabel value="#{bundle.Patrimonio}" />
                <h:selectOneMenu value="#{emprestimoController.emprestimo.patrimonio.id}">
                    <f:selectItems value="#{patrimonioController.selectPatrimonios}"/>
                </h:selectOneMenu>

                <h:outputLabel value="#{bundle.Pessoa}" />
                <h:selectOneMenu value="#{emprestimoController.emprestimo.pessoa.id}">
                    <f:selectItems value="#{pessoaController.selectPessoas}"/>
                </h:selectOneMenu>

            </h:panelGrid>
            <h:panelGrid columns="2" width="100%">
                <p:commandButton value="#{bundle.Salvar}"    action="#{emprestimoController.Salvar}"          ajax="true" update="emprestimo_newF"/>
                <p:commandButton value="#{bundle.Cancelar}"  action="#{emprestimoController.NovoEmprestimo}"      ajax="true" update="emprestimo_newF"  onclick="emprestimo_new.hide();"/>
            </h:panelGrid>


        </h:form>
    </p:dialog>
</ui:fragment>